home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Acao / BlueCustom.swf / scripts / frame_630 / PlaceObject2_123_67 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2008-09-26  |  2.8 KB  |  117 lines

  1. onClipEvent(enterFrame){
  2.    if(die == 0)
  3.    {
  4.       if(this._currentframe < 10)
  5.       {
  6.          this.gotoAndPlay("die");
  7.       }
  8.    }
  9.    if(die == 1)
  10.    {
  11.       if(this._x > 2000)
  12.       {
  13.          this._x = -900;
  14.       }
  15.       if(this._x < -1000)
  16.       {
  17.          this._x = 1900;
  18.       }
  19.       if(this._y > 2000)
  20.       {
  21.          this._y = 1900;
  22.          this._rotation += 180;
  23.       }
  24.       this._xscale = mesize;
  25.       this._yscale = mesize;
  26.       if(this._y < 500)
  27.       {
  28.          if(this._x < 700)
  29.          {
  30.             if(this._x > 0)
  31.             {
  32.                myRadians = Math.atan2(this._y - _root.player._y,this._x - _root.player._x);
  33.                xleg = this._x - _root.player._x;
  34.                yleg = this._y - _root.player._y;
  35.                scared = Math.sqrt(xleg * xleg + yleg * yleg);
  36.                toploc = (_root.depth._y - this._y) * -1;
  37.             }
  38.          }
  39.       }
  40.       if(this._y < _root.depth._y)
  41.       {
  42.          air += 0.4;
  43.          if(this._rotation > 0)
  44.          {
  45.             if(this._rotation < 90)
  46.             {
  47.                this._rotation -= 3;
  48.             }
  49.          }
  50.          if(this._rotation < 180)
  51.          {
  52.             if(this._rotation > 90)
  53.             {
  54.                this._rotation += 3;
  55.             }
  56.          }
  57.       }
  58.       else if(air > 0.5)
  59.       {
  60.          air -= 0.5;
  61.       }
  62.       if(movey == 1)
  63.       {
  64.          this._x += _global.xgo;
  65.          this._y += _global.ygo + air;
  66.       }
  67.       this._x += Math.cos(3.141592653589793 * this._rotation / 180) * mespeed;
  68.       this._y += Math.sin(3.141592653589793 * this._rotation / 180) * mespeed;
  69.       if(scared < 300 - mespeed * 10)
  70.       {
  71.          if(toploc < 20)
  72.          {
  73.             if(_root.player._x < this._x)
  74.             {
  75.                this._rotation += 10;
  76.             }
  77.             else
  78.             {
  79.                this._rotation -= 10;
  80.             }
  81.          }
  82.          else
  83.          {
  84.             myDegrees = Math.round(myRadians * 180 / 3.141592653589793);
  85.             if(this._rotation > myDegrees)
  86.             {
  87.                this._rotation -= turnspeed;
  88.             }
  89.             if(this._rotation < myDegrees)
  90.             {
  91.                this._rotation += turnspeed;
  92.             }
  93.          }
  94.       }
  95.    }
  96.    else if(movey == 1)
  97.    {
  98.       this._x += _global.xgo;
  99.       this._y += _global.ygo;
  100.    }
  101.    if(this.eat.hitTest(_root.player.eat))
  102.    {
  103.       die = 0;
  104.       this.gotoAndPlay("die");
  105.       multiplyer = 1;
  106.       if(_root.tools.powerup1._currentframe > 10)
  107.       {
  108.          multiplyer = 2;
  109.       }
  110.       scoreity = Math.round(scoreworth * multiplyer);
  111.       _root.tools.instascore.text = "+" + scoreity;
  112.       _root.tools.instblock._alpha = 0;
  113.       _global.scoreit = _global.scoreit * 1 + scoreity;
  114.       _global.boost += scoreity / 10;
  115.    }
  116. }
  117.